package Database;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

public class GetTime {
    public static void GetCurrentTime() throws Exception{
        Connection conn = Connect.getConnection();

        String sql = "select now() as SystemTime";
        Statement smt = conn.createStatement();
        ResultSet rs = smt.executeQuery(sql);
        while (rs.next()){
        System.out.println(rs.getTimestamp("SystemTime"));}

        rs.close();
        smt.close();
    }

    public static void main(String[] args) {
        try {
            GetTime.GetCurrentTime();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
